<?php 
if (!defined('e107_INIT')) { exit; }
require_once(e_HANDLER.'shortcode_handler.php');
global $tp;
$category_shortcodes = $tp->e_sc->parse_scbatch(__FILE__);

/*
SC_BEGIN CATEGORY_LIST
    global $shop_settings, $e107, $eplug_folder, $PLUGINS_DIRECTORY, $tp;
    $item = getcachedvars('categorylist');
    $text = "<table width='100%' style='border-collapse: collapse;'><tr>";
    switch ($shop_settings['category_display']) {
        case 1:
            $counter = 0;
            foreach ($item as $cat) {
                $Category = $cat["catName"];
                $CatID = $cat["catId"];
                $CatDesc = $tp->toHTML($cat["catDesc"], TRUE);
                $CatImg = $cat["catimg"];
                $HasItems = $cat["items"];
                if ($shop_settings['catstyle_name_bold'] == 'on') $catname = "<b>" . $Category . "</b>";
                if ($shop_settings['catstyle_thumb_border'] != '' && $shop_settings['catstyle_thumb_border'] != NULL) 
                    $border = "style='border: ".$shop_settings['catstyle_thumb_border'].";' ";
                else $border = "style='border: none;' ";
                if ($shop_settings['catstyle_forum_border'] != '' && $shop_settings['catstyle_forum_border'] != NULL) 
                    $tblborder = "border: ".$shop_settings['catstyle_forum_border'].";";
                else $tblborder = "border: none;";
                if ($shop_settings['catstyle_forum_padding'] != '' && $shop_settings['catstyle_forum_padding'] != NULL) 
                    $tblcellpadding = "padding: ".$shop_settings['catstyle_forum_padding']."; ";
                else $tblcellpadding = "padding: 0px; ";
                if ($shop_settings['catstyle_forum_halign'] != '') $tbltxthalign = "text-align: ".$shop_settings['catstyle_forum_halign']."; ";
                if ($shop_settings['catstyle_forum_valign'] != '') $tbltxtvalign = "vertical-align: ".$shop_settings['catstyle_forum_valign']."; ";
                if ($CatImg == "") $CatImg = "default.gif";
                if ($shop_settings['catstyle_thumb_noscale'] == 'on') $noscale = "+noscale";
                if ($counter % 3 == 0 && $counter != 0) 
                    $text.= "</tr><tr>";
                if ($HasItems == 2) {
                    $text .= "
                    <td width='18%' style='text-align: center; padding: 5px 1% 2px 1%;".$tblborder."'>
                        <a href='index.php?cat=$CatID'>
                            <img ".$border."src='".e_IMAGE_ABS."thumb.php?".
                            $e107->file_path.$PLUGINS_DIRECTORY.$eplug_folder."/images/category/$CatImg".
                            "+".$shop_settings['catstyle_thumb_width'].$noscale."' />
                        </a>
                    </td>
                    <td width='26%' style='".$tbltxthalign.$tblcellpadding.$tbltxtvalign.$tblborder."'>
                        <a href='index.php?cat=$CatID'>".$catname."</a>
                    </td>";
                } else {
                    $text .= "
                    <td width='18%' style='text-align: center; padding: 5px 1% 2px 1%;".$tblborder."'>
                        <a href='products.php?cat=$CatID'>
                            <img ".$border."src='".e_IMAGE_ABS."thumb.php?".
                            $e107->file_path.$PLUGINS_DIRECTORY.$eplug_folder."/images/category/$CatImg".
                            "+".$shop_settings['catstyle_thumb_width'].$noscale."' />
                        </a>
                    </td>
                    <td width='26%' style='".$tbltxthalign.$tblcellpadding.$tbltxtvalign.$tblborder."'>
                        <a href='products.php?cat=$CatID'>".$catname."</a>
                    </td>";
                }
                $text .= "<td width='46%' style='".$tbltxthalign.$tblcellpadding.$tbltxtvalign.$tblborder."'>".$CatDesc."</td>";
                $counter += 3;
            }
            break;
        case 2:
            $counter = 0;
            foreach ($item as $cat) {
                $Category = $cat["catName"];
                $CatID = $cat["catId"];
                $CatDesc = $cat["catDesc"];
                $CatImg = $cat["catimg"];
                $HasItems = $cat["items"];
                $columnwidth = floor(100 / intval($shop_settings['catstyle_pcs_per_row']));
                if ($shop_settings['catstyle_thumb_only'] == 'off') $catname = "<br />$Category";
                if ($shop_settings['catstyle_name_bold'] == 'on') $catname = "<b>" . $catname . "</b>";
                if ($shop_settings['catstyle_thumb_border'] != '' && $shop_settings['catstyle_thumb_border'] != NULL) 
                    $border = "style='border: ".$shop_settings['catstyle_thumb_border'].";' ";
                else $border = "style='border: none;' ";
                if ($CatImg == "") $CatImg = "default.gif";
                if ($shop_settings['catstyle_thumb_noscale'] == 'on') $noscale = "+noscale";
                if ($counter % $shop_settings['catstyle_pcs_per_row'] == 0 && $counter != 0) 
                    $text.= "</tr><tr><td colspan='3' style='height: 5px;'>&nbsp;</td></tr><tr>";
                $text .= "<td width='".$columnwidth."%' style='text-align: center;'>";
                if ($HasItems == 2) {
                    $text .= "<a href='index.php?cat=$CatID'>
                        <img ".$border."src='".e_IMAGE_ABS."thumb.php?".
                        $e107->file_path.$PLUGINS_DIRECTORY.$eplug_folder."/images/category/$CatImg".
                        "+".$shop_settings['catstyle_thumb_width'].$noscale."' />".$catname."</a>";
                } else {
                    $text.= "<a href='products.php?cat=$CatID'>
                        <img ".$border."src='".e_IMAGE_ABS."thumb.php?".
                        $e107->file_path.$PLUGINS_DIRECTORY.$eplug_folder."/images/category/$CatImg".
                        "+".$shop_settings['catstyle_thumb_width'].$noscale."' />".$catname."</a>";
                }
                $text .= "</td>";
                $counter++;
            }
            while ($counter % $shop_settings['catstyle_pcs_per_row'] != 0) {
                $text .= "<td>&nbsp;</td>";
                $counter++;
            }
            break;
    }
    $text .= "</tr></table>";
    return $text;
SC_END
*/
